<div class="food_list">
<div id="breakfasts">
    <h3>Завтраки</h3>
    <table class="view_products_table">
       
        <?php foreach ($breakfasts as $breakfast): ?>
        <tr>
            <td style="width: 120px;"><span id="name<?php echo $breakfast->getId(); ?>"><?php echo $breakfast->getName(); ?></span></td>
            <td style="width: 230px;"><span><?php echo $breakfast->getDescription(); ?></span></td>
            <td><span><?php echo $breakfast->getWeight(); ?></span> гр.</td>
            <td><span><?php echo $breakfast->getPrice(); ?></span> сом</td>
            <?php if ($user->isAuthenticated()): ?>
            <td>
                <select id="quantity<?php echo $breakfast->getId(); ?>">
                    <?php for ($i = 1; $i < 11; $i++): ?>
                    <option value="<?= $i ?>"><?= $i ?></option>
                    <? endfor; ?>
                </select>
            </td>
            <td><a href="#" class="addToCart" id="<?php echo $breakfast->getId(); ?>">Заказать</a></td>
            <?php endif; ?>
        </tr>
        <?php endforeach; ?>
    </table>
</div>
<br/>
<div id="first_dishes">
    <h3>Первые блюда</h3>
    <table class="view_products_table">
        <?php foreach ($first_dishes as $first_dishe): ?>
        <tr>
            <td style="width: 120px;"><span id="name<?php echo $first_dishe->getId(); ?>"><?php echo $first_dishe->getName(); ?></span></td>
            <td style="width: 230px;"><span><?php echo $first_dishe->getDescription(); ?></span></td>
            <td><span><?php echo $first_dishe->getWeight(); ?></span> гр.</td>
            <td><span><?php echo $first_dishe->getPrice(); ?></span> сом</td>
            <?php if ($user->isAuthenticated()): ?>
            <td>
                <select id="quantity<?php echo $first_dishe->getId(); ?>">
                    <?php for ($i = 1; $i < 11; $i++): ?>
                    <option value="<?= $i ?>"><?= $i ?></option>
                    <? endfor; ?>
                </select>
            </td>
            <td><a href="#" class="addToCart" id="<?php echo $first_dishe->getId(); ?>">Заказать</a></td>
            <?php endif; ?>
        </tr>
        <?php endforeach; ?>
    </table>
</div>
<br/>
<div id="salads">
    <h3>Салаты</h3>
    <table class="view_products_table">
        <?php foreach ($salads as $salad): ?>
        <tr>
            <td style="width: 120px;"><span id="name<?php echo $salad->getId(); ?>"><?php echo $salad->getName(); ?></span></td>
            <td style="width: 230px;"><span><?php echo $salad->getDescription(); ?></span></td>
            <td><span><?php echo $salad->getWeight(); ?></span> гр.</td>
            <td><span><?php echo $salad->getPrice(); ?></span> сом</td>
            <?php if ($user->isAuthenticated()): ?>
            <td>
                <select id="quantity<?php echo $salad->getId(); ?>">
                    <?php for ($i = 1; $i < 11; $i++): ?>
                    <option value="<?= $i ?>"><?= $i ?></option>
                    <? endfor; ?>
                </select>
            </td>
            <td><a href="#" class="addToCart" id="<?php echo $salad->getId(); ?>">Заказать</a></td>
            <?php endif; ?>
        </tr>
        <?php endforeach; ?>
    </table>
</div>
<br/>
<div id="second_dishes">
    <h3>Вторые блюда</h3>
    <table class="view_products_table">
        <?php foreach ($second_dishes as $second_dishe): ?>
        <tr>
            <td style="width: 120px;"><span id="name<?php echo $second_dishe->getId(); ?>"><?php echo $second_dishe->getName(); ?></span></td>
            <td style="width: 230px;"><span><?php echo $second_dishe->getDescription(); ?></span></td>
            <td><span><?php echo $second_dishe->getWeight(); ?></span> гр.</td>
            <td><span><?php echo $second_dishe->getPrice(); ?></span> сом</td>
            <?php if ($user->isAuthenticated()): ?>
            <td>
                <select id="quantity<?php echo $second_dishe->getId(); ?>">
                    <?php for ($i = 1; $i < 11; $i++): ?>
                    <option value="<?= $i ?>"><?= $i ?></option>
                    <? endfor; ?>
                </select>
            </td>
            <td><a href="#" class="addToCart" id="<?php echo $second_dishe->getId(); ?>" catid="<?php echo $second_dishe->getCategory()->getId(); ?>">Заказать</a></td>
            <?php endif; ?>
        </tr>
        <?php endforeach; ?>
    </table>
</div>
<br/>
<div id="garnirs">
    <h3>Гарниры</h3>
    <table class="view_products_table">
        <?php foreach ($garnirs as $garnir): ?>
        <tr>
            <td style="width: 120px;"><span id="name<?php echo $garnir->getId(); ?>"><?php echo $garnir->getName(); ?></span></td>
            <td style="width: 230px;"><span><?php echo $garnir->getDescription(); ?></span></td>
            <td><span><?php echo $garnir->getWeight(); ?></span> гр.</td>
            <td><span><?php echo $garnir->getPrice(); ?></span> сом</td>
            <?php if ($user->isAuthenticated()): ?>
            <td>
                <select id="quantity<?php echo $garnir->getId(); ?>">
                    <?php for ($i = 1; $i < 11; $i++): ?>
                    <option value="<?= $i ?>"><?= $i ?></option>
                    <? endfor; ?>
                </select>
            </td>
            <td><a href="#" class="addToCart" id="<?php echo $garnir->getId(); ?>">Заказать</a></td>
            <?php endif; ?>
        </tr>
        <?php endforeach; ?>
    </table>
</div>

<br/>
<div id="buhlo">
    <h3>Бухло</h3>
    <table class="view_products_table">
        <?php foreach ($buhlos as $buhlo): ?>
        <tr>
            <td style="width: 120px;"><span id="name<?php echo $buhlo->getId(); ?>"><?php echo $buhlo->getName(); ?></span></td>
            <td style="width: 230px;"><span><?php echo $buhlo->getDescription(); ?></span></td>
            <td><span><?php echo $buhlo->getPrice(); ?></span> сом</td>
            <?php if ($user->isAuthenticated()): ?>
            <td>
                <select id="quantity<?php echo $buhlo->getId(); ?>">
                    <?php for ($i = 1; $i < 11; $i++): ?>
                    <option value="<?= $i ?>"><?= $i ?></option>
                    <? endfor; ?>
                </select>
            </td>
            <td><a href="#" class="addToCart" id="<?php echo $buhlo->getId(); ?>">Заказать</a></td>
            <?php endif; ?>
        </tr>
        <?php endforeach; ?>
    </table>
</div>
<br/>
<div id="zapivon">
    <h3>Запивон</h3>
    <table class="view_products_table">
        <?php foreach ($zapivons as $zapivon): ?>
        <tr>
            <td style="width: 120px;"><span id="name<?php echo $buhlo->getId(); ?>"><?php echo $zapivon->getName(); ?></span></td>
            <td style="width: 230px;"><span><?php echo $zapivon->getDescription(); ?></span></td>
            <td><span><?php echo $zapivon->getPrice(); ?></span> сом</td>
            <?php if ($user->isAuthenticated()): ?>
            <td>
                <select id="quantity<?php echo $zapivon->getId(); ?>">
                    <?php for ($i = 1; $i < 11; $i++): ?>
                    <option value="<?= $i ?>"><?= $i ?></option>
                    <? endfor; ?>
                </select>
            </td>
            <td><a href="#" class="addToCart" id="<?php echo $zapivon->getId(); ?>">Заказать</a></td>
            <?php endif; ?>
        </tr>
        <?php endforeach; ?>
    </table>
</div>
<br/>
<?php 
    if ($user->isAuthenticated()) {
        echo include_partial('products/cart', array('orders' => $orders, 'orders_combined' => $orders_combined, 'user' => $user)); 
    }
?>
</div>
